<template>
  <div class="goods-list">
    <div class="goods-item">
      <img
        src="https://gd1.alicdn.com/imgextra/i1/292911747/O1CN016L5tPE1OmAQX18XUl_!!292911747.jpg"
        alt
      >
      <h1 class="title">Xiaomi/小米 小米9透明SE全面屏尊享版旗舰星plus全新手机骁龙855</h1>
      <div class="info">
        <p class="price">
          <span class="now">¥899</span>
          <span class="old">¥999</span>
        </p>
        <p class="sell">
          <span>热卖中</span>
          <span>剩余60件</span>
        </p>
      </div>
    </div>

    <div class="goods-item">
      <img
        src="https://gd1.alicdn.com/imgextra/i4/292911747/O1CN01zFnqkl1OmAQgXP8wy_!!292911747.jpg"
        alt
      >
      <h1 class="title">Xiaomi/小米</h1>
      <div class="info">
        <p class="price">
          <span class="now">¥899</span>
          <span class="old">¥999</span>
        </p>
        <p class="sell">
          <span>热卖中</span>
          <span>剩余60件</span>
        </p>
      </div>
    </div>

    <div class="goods-item">
      <img
        src="https://gd4.alicdn.com/imgextra/i4/292911747/O1CN01uQQwfE1OmAQRJH5RS_!!292911747.jpg"
        alt
      >
      <h1 class="title">Xiaomi/小米 小米9透明SE全面屏尊享版旗舰星plus全新手机骁龙855</h1>
      <div class="info">
        <p class="price">
          <span class="now">¥899</span>
          <span class="old">¥999</span>
        </p>
        <p class="sell">
          <span>热卖中</span>
          <span>剩余60件</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
</script>

<style lang="scss" scoped>
.goods-list {
  display: flex; // 子盒子高度自动拉伸
  flex-wrap: wrap; // 强行换行
  padding: 7px;
  justify-content: space-between; // 贴端对齐
  .goods-item {
    width: 49%;
    border: 1px solid #ccc;
    box-shadow: 0 0 8px #ccc;
    margin: 4px 0;
    padding: 2px;
    display: flex; // 实现每一项在纵轴贴端对齐
    flex-direction: column;
    justify-content: space-between;
    min-height: 244px;
    img {
      width: 100%;
    }
    .title {
      font-size: 14px;
    }
    .info {
      background-color: #eee;
      p {
        margin: 0;
        padding: 0 5px;
      }
      .price {
        .now {
          color: red;
          font-weight: bold;
          font-size: 16px;
        }
        .old {
          text-decoration: line-through;
          font-size: 12px;
          margin-left: 10px;
        }
      }
      .sell {
        display: flex;
        justify-content: space-between;
        font-size: 13px;
      }
    }
  }
}
</style>
